﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAL;

namespace BLL
{
   public class ClsTimKiemBus
    {
       public ClsTimKiemInfo Info = new ClsTimKiemInfo();
       public DataTable MaGK()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @"SELECT MaGK FROM TTCHUNG WHEEE TenGK LIKE'%" + Info.TenGK + "%'AND Tinh LIKE '%"+Info.Tinh+"'%";

           if (oConnection.ExecuteSelect(strSql))
           {
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable ThongTinChung()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @"SELECT TTCHUNG.MaGK,TTCHUNG.TenGK,TTCHUNG.SoHieuTL,TTCHUNG.MucNuocTinh,DMTangChuaNuoc.TenTangChuaNuoc,TTCHUNG.NgayKC,TTCHUNG.NgayKT,DMDeAnBC.TenDeAnBC,TinhTP.TenTinh,TTCHUNG.ID,TTCHUNG.GhiChu 
                              FROM TTCHUNG, DMTangChuaNuoc, DMDeAnBC,TinhTP 
                              WHERE TTCHUNG.TangChuaNNC= DMTangChuaNuoc.MaTangChuaNuoc 
                                    AND TTCHUNG.DeAnBC = DMDeAnBC.MaDeAnBC 
                                    AND TTCHUNG.Tinh=TinhTP.MaTinh
                                    AND TenGK LIKE'%" + Info.TenGK +
                                    "%'AND Tinh LIKE '%" + Info.Tinh + "%'";        

           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               int i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable ThachHocLoKhoan()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @"SELECT TTCHUNG.MaGK,TTCHUNG.TenGK,TinhTP.TenTinh,ThachHoc.MaLop,ThachHoc.ChieuSau,ThachHoc.DoDayThucLop,ThachHoc.TyLeMau,ThachHoc.ThachHoc1,ThachHoc.ThachHoc2,ThachHoc.ThachHoc3,ThachHoc.ThachHoc4,ThachHoc.MoTa
                              FROM TTCHUNG, ThachHoc,TinhTP
                             WHERE TTCHUNG.Tinh=TinhTP.MaTinh
                                    AND TTCHUNG.MaGK=ThachHoc.MaGK
                                    AND TenGK LIKE'%" + Info.TenGK +
                                   "%'AND Tinh LIKE '%" + Info.Tinh + "%'";     


           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               int i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable OngChongOngLoc()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @"SELECT TTCHUNG.MaGK,TTCHUNG.TenGK,TinhTP.TenTinh,OngChongLoc.MaLop,OngChongLoc.ChieuSau,OngChongLoc.DKTrong,OngChongLoc.DKNgoai,OngChongLoc.VLLamOng,OngChongLoc.KichThuocLoOng,OngChongLoc.MoTa,LoaiOngLoc.TenOngLoc
                               FROM TTCHUNG, OngChongLoc,TinhTP,LoaiOngLoc
                              WHERE TTCHUNG.Tinh=TinhTP.MaTinh
                                AND OngChongLoc.LoaiOngLoc=LoaiOngLoc.MaOngLoc
                                AND TTCHUNG.MaGK=OngChongLoc.MaGK
                                AND TenGK LIKE'%" + Info.TenGK +
                                "%'AND Tinh LIKE '%" + Info.Tinh + "%'";    


           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               int i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable KienTrucTruocChongOng()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @"SELECT TTCHUNG.MaGK,TTCHUNG.TenGK,TinhTP.TenTinh,KTTruocChongOng.MaLop,KTTruocChongOng.DKKhoan,KTTruocChongOng.ChieuSau
                               FROM TTCHUNG, KTTruocChongOng,TinhTP
                               WHERE TTCHUNG.MaGK= KTTruocChongOng.MaGK 
                                AND TTCHUNG.Tinh=TinhTP.MaTinh
                                AND TenGK LIKE'%" + Info.TenGK +
                                "%'AND Tinh LIKE '%" + Info.Tinh + "%'";   
           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               int i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable DuLieuMau()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @"SELECT TTCHUNG.MaGK,TTCHUNG.TenGK,TinhTP.TenTinh,DuLieuMau.MaMau,DuLieuMau.TenMau,DuLieuMau.ChieuSauLayMau,DuLieuMau.ThoiGianLayMau,DuLieuMau.TheTichMau,KieuLoDungMau
                               FROM TTCHUNG, DuLieuMau,TinhTP
                               WHERE TTCHUNG.MaGK= DuLieuMau.MaGK 
                                AND TTCHUNG.Tinh=TinhTP.MaTinh
                                AND TenGK LIKE'%" + Info.TenGK +
                                "%'AND Tinh LIKE '%" + Info.Tinh + "%'";   
           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               int i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable KetQuaBomTN()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @"SELECT TTCHUNG.MaGK,TTCHUNG.TenGK,TinhTP.TenTinh,BomThiNghiem.MaBomTN,BomThiNghiem.ThoiGianBD,BomThiNghiem.ThoiGianKT,BomThiNghiem.HeSoTham,BomThiNghiem.HSDanNuoc,BomThiNghiem.HSNhaNuoc,BomThiNghiem.HSTruyenAp,BomThiNghiem.BKAnhHuong,KieuBomTN.TenKieuBomTN
                               FROM TTCHUNG, BomThiNghiem,TinhTP,KieuBomTN
                               WHERE TTCHUNG.MaGK=BomThiNghiem.MaGK 
                                AND TTCHUNG.Tinh=TinhTP.MaTinh
                                AND BomThiNghiem.MaKieuBomTN=KieuBomTN.MaKieuBomTN
                                AND TenGK LIKE'%" + Info.TenGK +
                                "%'AND Tinh LIKE '%" + Info.Tinh + "%'";   
           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               int i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable TinhChatVatLy()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @" SELECT TTCHUNG.ID,TTCHUNG.TenGK,DuLieuMau.TenMau,TTThiNghiemMau.CoQuanTN,TTThiNghiemMau.NgayTN,TTThiNghiemMau.SoLanTN,TTThiNghiemMau.NguoiTN,TTThiNghiemMau.NguoiKiemTraTN,
                              TinhChatVatLy.MaThiNghiem,TinhChatVatLy.NhietDo,TinhChatVatLy.MauSac,TinhChatVatLy.MuiVi,TinhChatVatLy.DoDuc,TinhChatVatLy.DoDanDien,TinhChatVatLy.TDS,TinhChatVatLy.TSS,TinhChatVatLy.DoPhongXaAnfa,TinhChatVatLy.DoPhongXaBeta
                              FROM TTCHUNG,DuLieuMau,TTThiNghiemMau,TinhChatVatLy
                              WHERE TTCHUNG.MaGK= DuLieuMau.MaGK
                              AND DuLieuMau.MaMau=TinhChatVatLy.MaMau 
                              AND TinhChatVatLy.MaThiNghiem=TTThiNghiemMau.MaThiNghiem
                              AND TTCHUNG.TenGK like'%" + Info.TenGK +
                             "%'AND TenMau LIKE '%" + Info.TenMau +
                             "%'AND TTCHUNG.Tinh LIKE '%" + Info.Tinh + "%'";  
           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               Int32 i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable ThanhPhanHoaHoc()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @" SELECT TTCHUNG.ID,TTCHUNG.TenGK,DuLieuMau.TenMau,TTThiNghiemMau.CoQuanTN,TTThiNghiemMau.NgayTN,TTThiNghiemMau.SoLanTN,TTThiNghiemMau.NguoiTN,TTThiNghiemMau.NguoiKiemTraTN,
                              ThanhPhanHoaHoc.DoPH,ThanhPhanHoaHoc.CO2TuDo,ThanhPhanHoaHoc.CO2LienHe,ThanhPhanHoaHoc.CO2XamThuc,ThanhPhanHoaHoc.HCO3,ThanhPhanHoaHoc.OH,ThanhPhanHoaHoc.CO3,
                              ThanhPhanHoaHoc.Phenol,ThanhPhanHoaHoc.DoCungCa,ThanhPhanHoaHoc.DoCungMg,ThanhPhanHoaHoc.Cl,ThanhPhanHoaHoc.SO4,ThanhPhanHoaHoc.Fe2,ThanhPhanHoaHoc.Fe3,ThanhPhanHoaHoc.F,ThanhPhanHoaHoc.H2S,                                             
                              ThanhPhanHoaHoc.HCCuaAxitSilicic,ThanhPhanHoaHoc.PO4,ThanhPhanHoaHoc.NO2,ThanhPhanHoaHoc.NO3,ThanhPhanHoaHoc.NH4,ThanhPhanHoaHoc.DO,ThanhPhanHoaHoc.COD,ThanhPhanHoaHoc.BOD,ThanhPhanHoaHoc.CN,
                              ThanhPhanHoaHoc.Cd,ThanhPhanHoaHoc.Ni,ThanhPhanHoaHoc.Cr3,ThanhPhanHoaHoc.Cr6,ThanhPhanHoaHoc.Hg,ThanhPhanHoaHoc.Pd,ThanhPhanHoaHoc.Asen,ThanhPhanHoaHoc.Be,ThanhPhanHoaHoc.Sb,ThanhPhanHoaHoc.Se,
                              ThanhPhanHoaHoc.V,ThanhPhanHoaHoc.Sn,ThanhPhanHoaHoc.Zn,ThanhPhanHoaHoc.Cu,ThanhPhanHoaHoc.Mn,ThanhPhanHoaHoc.DauMo,ThanhPhanHoaHoc.ChatTayRua,ThanhPhanHoaHoc.TongHoaChatBVTV,ThanhPhanHoaHoc.DDT   
                              FROM TTCHUNG,DuLieuMau,TTThiNghiemMau,ThanhPhanHoaHoc
                              WHERE TTCHUNG.MaGK= DuLieuMau.MaGK
                              AND DuLieuMau.MaMau=ThanhPhanHoaHoc.MaMau 
                              AND ThanhPhanHoaHoc.MaThiNghiem=TTThiNghiemMau.MaThiNghiem
                              AND TTCHUNG.TenGK like'%" + Info.TenGK +
                             "%'AND TenMau LIKE '%" + Info.TenMau +
                              "%'AND TTCHUNG.Tinh LIKE '%" + Info.Tinh + "%'";  
           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               Int32 i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable HamLuongViSinh()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @" SELECT TTCHUNG.ID,TTCHUNG.TenGK,DuLieuMau.TenMau,TTThiNghiemMau.CoQuanTN,TTThiNghiemMau.NgayTN,TTThiNghiemMau.SoLanTN,TTThiNghiemMau.NguoiTN,TTThiNghiemMau.NguoiKiemTraTN,
                              HamLuongViSinh.MaThiNghiem,HamLuongViSinh.TongColiform,HamLuongViSinh.EColiform,HamLuongViSinh.TongViTrung,HamLuongViSinh.ViTrungHieuKhi,HamLuongViSinh.TrucTrungDaiTrang,HamLuongViSinh.KetLuanSuDung
                              FROM TTCHUNG,DuLieuMau,TTThiNghiemMau,HamLuongViSinh
                              WHERE TTCHUNG.MaGK= DuLieuMau.MaGK
                              AND DuLieuMau.MaMau=HamLuongViSinh.MaMau 
                              AND HamLuongViSinh.MaThiNghiem=TTThiNghiemMau.MaThiNghiem
                              AND TTCHUNG.TenGK like'%" + Info.TenGK +
                             "%'AND TenMau LIKE '%" + Info.TenMau +
                              "%'AND TTCHUNG.Tinh LIKE '%" + Info.Tinh + "%'";  
           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               Int32 i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable ChatLuongNuoc()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @" SELECT ThanhPhanHoaHoc.DoPH,ThanhPhanHoaHoc.CO2TuDo,ThanhPhanHoaHoc.CO2LienHe,ThanhPhanHoaHoc.CO2XamThuc,ThanhPhanHoaHoc.HCO3,ThanhPhanHoaHoc.OH,ThanhPhanHoaHoc.CO3,
                                                ThanhPhanHoaHoc.Phenol,ThanhPhanHoaHoc.DoCungCa,ThanhPhanHoaHoc.DoCungMg,ThanhPhanHoaHoc.Cl,ThanhPhanHoaHoc.SO4,ThanhPhanHoaHoc.Fe2,ThanhPhanHoaHoc.Fe3,ThanhPhanHoaHoc.F,ThanhPhanHoaHoc.H2S,                                             
                                                ThanhPhanHoaHoc.HCCuaAxitSilicic,ThanhPhanHoaHoc.PO4,ThanhPhanHoaHoc.NO2,ThanhPhanHoaHoc.NO3,ThanhPhanHoaHoc.NH4,ThanhPhanHoaHoc.DO,ThanhPhanHoaHoc.COD,ThanhPhanHoaHoc.BOD,ThanhPhanHoaHoc.CN,
                                                ThanhPhanHoaHoc.Cd,ThanhPhanHoaHoc.Ni,ThanhPhanHoaHoc.Cr3,ThanhPhanHoaHoc.Cr6,ThanhPhanHoaHoc.Hg,ThanhPhanHoaHoc.Pd,ThanhPhanHoaHoc.Asen,ThanhPhanHoaHoc.Be,ThanhPhanHoaHoc.Sb,ThanhPhanHoaHoc.Se,
                                                ThanhPhanHoaHoc.V,ThanhPhanHoaHoc.Sn,ThanhPhanHoaHoc.Zn,ThanhPhanHoaHoc.Cu,ThanhPhanHoaHoc.Mn,ThanhPhanHoaHoc.DauMo,ThanhPhanHoaHoc.ChatTayRua,ThanhPhanHoaHoc.TongHoaChatBVTV,ThanhPhanHoaHoc.DDT,   
                                                HamLuongViSinh.TongColiform,HamLuongViSinh.EColiform,HamLuongViSinh.TongViTrung,HamLuongViSinh.ViTrungHieuKhi,HamLuongViSinh.TrucTrungDaiTrang,
                                                TinhChatVatLy.NhietDo,TinhChatVatLy.MauSac,TinhChatVatLy.MuiVi,TinhChatVatLy.DoDuc,TinhChatVatLy.DoDanDien,TinhChatVatLy.TDS,TinhChatVatLy.TSS,TinhChatVatLy.DoPhongXaAnfa,TinhChatVatLy.DoPhongXaBeta
                                         FROM DuLieuMau,TinhChatVatLy,ThanhPhanHoaHoc,HamLuongViSinh,TTCHUNG
                                         WHERE TTCHUNG.MaGk=DuLieuMau.MaGK
                                         AND DuLieuMau.MaMau=TinhChatVatLy.MaMau
                                         AND DuLieuMau.MaMau=ThanhPhanHoaHoc.MaMau
                                         AND DuLieuMau.MaMau=HamLuongViSinh.MaMau
                                         AND TTCHUNG.TenGK like'%" + Info.TenGK + "%'AND TenMau LIKE '%" + Info.TenMau + "%'AND TTCHUNG.Tinh LIKE '%" + Info.Tinh + "%'";  
         
           if (oConnection.ExecuteSelect(strSql))
           {
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable QuyChuan()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @" SELECT ChiTieuThanhPhanHoaHoc.DoPH,ChiTieuThanhPhanHoaHoc.CO2TuDo,ChiTieuThanhPhanHoaHoc.CO2LienHe,ChiTieuThanhPhanHoaHoc.CO2XamThuc,ChiTieuThanhPhanHoaHoc.HCO3,ChiTieuThanhPhanHoaHoc.OH,ChiTieuThanhPhanHoaHoc.CO3,
                                     ChiTieuThanhPhanHoaHoc.Phenol,ChiTieuThanhPhanHoaHoc.DoCungCa,ChiTieuThanhPhanHoaHoc.DoCungMg,ChiTieuThanhPhanHoaHoc.Cl,ChiTieuThanhPhanHoaHoc.SO4,ChiTieuThanhPhanHoaHoc.Fe2,ChiTieuThanhPhanHoaHoc.Fe3,ChiTieuThanhPhanHoaHoc.F,ChiTieuThanhPhanHoaHoc.H2S,                                             
                                     ChiTieuThanhPhanHoaHoc.HCCuaAxitSilicic,ChiTieuThanhPhanHoaHoc.PO4,ChiTieuThanhPhanHoaHoc.NO2,ChiTieuThanhPhanHoaHoc.NO3,ChiTieuThanhPhanHoaHoc.NH4,ChiTieuThanhPhanHoaHoc.DO,ChiTieuThanhPhanHoaHoc.COD,ChiTieuThanhPhanHoaHoc.BOD,ChiTieuThanhPhanHoaHoc.CN,
                                     ChiTieuThanhPhanHoaHoc.Cd,ChiTieuThanhPhanHoaHoc.Ni,ChiTieuThanhPhanHoaHoc.Cr3,ChiTieuThanhPhanHoaHoc.Cr6,ChiTieuThanhPhanHoaHoc.Hg,ChiTieuThanhPhanHoaHoc.Pd,ChiTieuThanhPhanHoaHoc.Asen,ChiTieuThanhPhanHoaHoc.Be,ChiTieuThanhPhanHoaHoc.Sb,ChiTieuThanhPhanHoaHoc.Se,
                                     ChiTieuThanhPhanHoaHoc.V,ChiTieuThanhPhanHoaHoc.Sn,ChiTieuThanhPhanHoaHoc.Zn,ChiTieuThanhPhanHoaHoc.Cu,ChiTieuThanhPhanHoaHoc.Mn,ChiTieuThanhPhanHoaHoc.DauMo,ChiTieuThanhPhanHoaHoc.ChatTayRua,ChiTieuThanhPhanHoaHoc.TongHoaChatBVTV,ChiTieuThanhPhanHoaHoc.DDT,   
                                     ChiTieuHamLuongViSinh.TongColiform,ChiTieuHamLuongViSinh.EColiform,ChiTieuHamLuongViSinh.TongViTrung,ChiTieuHamLuongViSinh.ViTrungHieuKhi,ChiTieuHamLuongViSinh.TrucTrungDaiTrang,
                                     ChiTieuTinhChatVatLy.NhietDo,ChiTieuTinhChatVatLy.MauSac,ChiTieuTinhChatVatLy.MuiVi,ChiTieuTinhChatVatLy.DoDuc,ChiTieuTinhChatVatLy.DoDanDien,ChiTieuTinhChatVatLy.TDS,ChiTieuTinhChatVatLy.TSS,ChiTieuTinhChatVatLy.DoPhongXaAnfa,ChiTieuTinhChatVatLy.DoPhongXaBeta
                              FROM QuyChuan,ChiTieuTinhChatVatLy,ChiTieuThanhPhanHoaHoc,ChiTieuHamLuongViSinh
                              WHERE QuyChuan.MaQuyChuan=ChiTieuTinhChatVatLy.MaQuyChuan
                              AND QuyChuan.MaQuyChuan=ChiTieuThanhPhanHoaHoc.MaQuyChuan
                              AND QuyChuan.MaQuyChuan=ChiTieuHamLuongViSinh.MaQuyChuan
                              AND QuyChuan.MaQuyChuan LIKE '%" + Info.MaQuyChuan +
                              "%'AND TTCHUNG.Tinh LIKE '%" + Info.Tinh + "%'";  
           if (oConnection.ExecuteSelect(strSql))
           {
                 return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }
       public DataTable BomTN()
       {
           ClsDataAccess oConnection = new ClsDataAccess();
           string strSql = @"SELECT TTCHUNG.TenGK,BomThiNghiem.MaBomTN,ChiTietBomTN.SoHieuDotBom,ChiTietBomTN.ChieuSauGKTruocBom,ChiTietBomTN.ChieuSauGKSauBom,ChiTietBomTN.ChieuDayTangChuaNuoc,ChiTietBomTN.CSDoanBatDauBTN,ChiTietBomTN.CSDoanKetThucBTN,ChiTietBomTN.SoGioBom,ChiTietBomTN.SoGioOnDinh,ChiTietBomTN.SoGioPhucHoi,ChiTietBomTN.MucNuocTinh,ChiTietBomTN.MucNuocDong,ChiTietBomTN.MucNuocHaThap,ChiTietBomTN.LuuLuongNuoc,ChiTietBomTN.NhietDoNuoc,ChiTietBomTN.NhietDoKhongKhi,ChiTietBomTN.GhiChu
                              FROM TTCHUNG,BomThiNghiem,ChiTietBomTN
                              WHERE TTCHUNG.MaGK= BomThiNghiem.MaGK 
                              AND BomThiNghiem.MaBomTN=ChiTietBomTN.MaBomTN
                              AND TTCHUNG.TenGK like'" + Info.TenGK + "%' AND ChiTietBomTN.MaBomTN like '" + Info.MaBomTN + "%'AND TTCHUNG.Tinh LIKE '%" + Info.Tinh + "%'";  


           if (oConnection.ExecuteSelect(strSql))
           {
               oConnection.ODataTable.Columns.Add("STT");
               int i = 0;
               foreach (DataRow oDRow in oConnection.ODataTable.Rows)
               {
                   oDRow["STT"] = (i + 1);
                   i++;
               }
               return oConnection.ODataTable;
           }
           else
           {
               return null;
           }
       }

    }
}
